home *** CD-ROM | disk | FTP | other *** search
- /***** BEGIN LICENSE BLOCK *****
- FlashGot - a Firefox extension for external download managers integration
- Copyright (C) 2004-2006 Giorgio Maone - g.maone@informaction.com
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
- ***** END LICENSE BLOCK *****/
- window.addEventListener("load",filePickerDirtyPatch,false);
-
- function filePickerDirtyPatch() {
- if(window.title && window.title.indexOf("FlashGot")==0
- && typeof(window.gotoDirectory)=="function") {
- window.fpdp_gotoDirectory=window.gotoDirectory;
- window.gotoDirectory=function(d) {
- window.fpdp_gotoDirectory(d);
- if( filePickerMode == nsIFilePicker.modeGetFolder
- && textInput && (!textInput.value)
- && d && d.path
- ) {
- textInput.value="."+(d.path.indexOf("\\")>-1?"\\":"/");
- textInput.select();
- textInput.focus();
- }
- }
- }
- }
-